import requests from "./ajax";

// Doctor
export const reqGetToken = ()=> requests.post('/token/admin')
export const reqGetAllDoctors = () => requests.get('/doctor')
export const reqLogin = (params) => requests.post('/login',  params )
export const reqGetDoctorById = (id) => requests.get('/doctor/' + id)
export const reqDeleteDoctorById = (id) => requests.delete('/doctor/' + id)
export const reqUpdateDoctorById = (doctor) => requests.put('/doctor', doctor)
export const reqAddDoctor = (doctor) => requests.post('/doctor', doctor)



// remote visit
export const reqGetExpertsByAreaId = (id) => requests.get('/doctor/expert/'+id)
export const reqGetCureCheckOutByCureId = (cid) => requests.get('/checkout/cure/' + cid)
export const reqGetHistoryCureByPatientId = (pid) => requests.get('/cure/history/' + pid)
export const reqGetCureVOs = () => requests.get('/cure/curevo')



// Patient
export const reqGetAllPatient = () => requests.get('/patient')
export const reqGetPatientById = (id) => requests.get('/patient/' + id)
export const reqAddPatient = (patient) => requests.post('/patient', patient)
export const reqDeletePatientById = (id) => requests.delete('/patient/' + id)
export const reqUpdatePatientById = (patient) => requests.put('/patient', patient)

// Area
export const reqGetAllArea = () => requests.get('/area')
export const reqGetAreaById = (id) => requests.get('/area/' + id)
export const reqAddArea = (area) => requests.post('/area', area)
export const reqDeleteAreaById = (id) => requests.delete('/area/' + id)
export const reqUpdateAreaById = (area) => requests.put('/area', area)

// Department
export const reqGetAllDepartment = () => requests.get('/department')
export const reqGetDepartmentById = (id) => requests.get('/department/' + id)
export const reqAddDepartment = (department) => requests.post('/department', department)
export const reqDeleteDepartmentById = (id) => requests.delete('/department/' + id)
export const reqUpdateDepartmentById = (department) => requests.put('/department', department)

// Hospital
export const reqGetAllHospital = () => requests.get('/hospital')
export const reqGetHospitalById = (id) => requests.get('/hospital/' + id)
export const reqAddHospital = (hospital) => requests.post('/hospital', hospital)
export const reqDeleteHospitalById = (id) => requests.delete('/hospital/' + id)
export const reqUpdateHospitalById = (hospital) => requests.put('/hospital', hospital)

// Role
export const reqGetAllRole = () => requests.get('/role')
export const reqGetRoleById = (id) => requests.get('/role/' + id)
export const reqAddRole = (role) => requests.post('/role', role)
export const reqDeleteRoleById = (id) => requests.delete('/role/' + id)
export const reqUpdateRoleById = (role) => requests.put('/role', role)

// Condition
export const reqGetAllCondition = () => requests.get('/condition')
export const reqGetConditionById = (id) => requests.get('/condition/' + id)
export const reqAddCondition = (condition) => requests.post('/condition', condition)
export const reqDeleteConditionById = (id) => requests.delete('/condition/' + id)
export const reqUpdateConditionById = (condition) => requests.put('/condition', condition)

// Cure
export const reqGetAllCure = () => requests.get('/cure')
export const reqGetCureById = (id) => requests.get('/cure/' + id)
export const reqAddCure = (cure) => requests.post('/cure', cure)
export const reqDeleteCureById = (id) => requests.delete('/cure/' + id)
export const reqUpdateCureById = (cure) => requests.put('/cure', cure)



// Checkout
export const reqGetAllCheckout = () => requests.get('/checkout')
export const reqGetCheckoutById = (id) => requests.get('/checkout/' + id)
export const reqAddCheckout = (checkout) => requests.post('/checkout', checkout)
export const reqDeleteCheckoutById = (id) => requests.delete('/checkout/' + id)
export const reqUpdateCheckoutById = (checkout) => requests.put('/checkout', checkout)

// VisitInfo
export const reqGetAllVisitInfo = () => requests.get('/visit-info')
export const reqGetVisitInfoById = (id) => requests.get('/visit-info/' + id)
export const reqAddVisitInfo = (visit) => requests.post('/visit-info', visit)
export const reqDeleteVisitInfoById = (id) => requests.delete('/visit-info/' + id)
export const reqUpdateVisitInfoById = (visit) => requests.put('/visit-info', visit)


// IllnessInfo
export const reqGetAllIllnessInfo = () => requests.get('/illness-info')
export const reqGetIllnessInfoById = (id) => requests.get('/illness-info/' + id)
export const reqAddIllnessInfo = (illness) => requests.post('/illness-info', illness)
export const reqDeleteIllnessInfoById = (id) => requests.delete('/illness-info/' + id)
export const reqUpdateIllnessInfoById = (illness) => requests.put('/illness-info', illness)



